<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>
<%@ include file="/commons/include/head-meta.inc.jsp"%>	
<script type="text/javascript">
	$(document).ready(function(){
		var msg='${param.returnMsg}';
		if(msg&&msg!=''){
			alert(msg);
		}
			
		var i=1;
		$('#addFile').click(function(){
			var fileName='uploadFile'+i;
			i++;
			var fileHtml='<div><input class="uploadFileCss" type="file" name="'+fileName+'" style="width: 500px"/><button class="delBtnClass" type="button" style="margin-right: 6px">删除</button></div>';
			$('#fileListId').append(fileHtml);
			f_iframeResize();
		});
		
		$('.delBtnClass').live('click',function(){
			$(this).parent().remove();
			f_iframeResize();
		});
		
		$('#upladFileBtn').click(function(){
			var dForm=document.forms[0];
			isValid=Validator.Validate(dForm,3);
			if(isValid){
				var attachArr=$('input[name="attactId"]');
				if(attachArr.length>0){
					dForm.submit();
					return;
				}
				var count=0;
				var uploads=$(".uploadFileCss");
				$.each(uploads,function(index,obj){
					if($(obj).val()!=''){
						count++;
					}
				});			
				if(count>0){
						dForm.submit();
				}else{
					alert('请至少选择一个要上传的附件！');
				}				
			}
		});
		
		
	});
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				background="<c:url value="/images/new/gxzl_index_2.gif"/>">
				<tr>
					<td width="20" height="32">&nbsp;</td>
					<td width="20"><img src="<c:url value="/images/new/dq_dot.gif"/>" width="15" height="12" /></td>
					<td>当前位置：<a href="opBusinessAnalysis.do">产品运营分析报告共享区</a>->上传</td>
					<td width="60"></td>
					<td width="200"></td>
					<td width="100"></td>
				</tr>
			</table>
			</td>
		</tr>
  <tr> 
    <td background="<c:url value="/images/home_4a.gif"/>"> 
      <table width="100%" height="300" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
        <tr>
          <td valign="top">
					<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top: 12px;" >
						<tr>
							<td height="5">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="5" height="5"><img src="<c:url value="/images/cphdzx_tab1.gif"/>" width="5" height="5" /></td>
										<td class="tdborderup"><img src="<c:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
										<td width="5"><img src="<c:url value="/images/cphdzx_tab2.gif"/>" width="5" height="5" /></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td class="tdborderleftright">
							<form action="opBusinessAnalysis.do?action=saveUpload" enctype="multipart/form-data" method="post" name="searchForm">
												<input name="appId" value="${businessAnalysis.appId }" type="hidden" />
												<table width="100%" border="0" cellspacing="0"
													cellpadding="7" align="center" class=tablecolor2>
													<tr>
														<td background="<c:url value="/images/catalog_manage_bbs_3.gif"/>"
															colspan="4">
															<span style="margin-top: 0px; margin-left: 14px">
																<img src="<c:url value="/images/catalog_manage_12.gif"/>" width=13 height=13 alt="">
															</span>
															<strong>基本信息</strong>
														</td>
													</tr>
													<tr>
														
														<td bgcolor="D6E3FA" width="14%">
															<div align="right" class="STYLE2">
																发起人：
															</div>
														</td>
														<td width="36%">${businessAnalysis.opUserCnName }
														</td>
														
														<td width="14%" bgcolor="D6E3FA">
															<div align="right" class="STYLE2">
																所在部门：
															</div>
														</td>
														<td width="36%">${businessAnalysis.orgCnName }</td>
													</tr>
													<tr>
														<td bgcolor="D6E3FA" width="14%">
															<div align="right" class="STYLE2">
																<font color="red">*</font>报告所属年月：
															</div>
														</td>
														<td colspan="3">
															<input name="issuse" type="text" value="${businessAnalysis.issuse }" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy年MM月'})" dataType="Require" msg="必填" />
															
														</td>
													</tr>
													<tr>
														<td bgcolor="D6E3FA" width="14%">
															<div align="right" class="STYLE2">
																<font color="red">*</font>上传附件：
															</div>
														</td>
														<td colspan="3" id="fileListId">
															<div><input class="uploadFileCss" type="file" name="uploadFile" style="width: 500px"/><button id="addFile" style="margin-right: 6px" type="button">添加</button></div>
												
														</td>
													</tr>
													<c:if test="${fn:length(attachList)>0 }">
													<tr>
														<td bgcolor="D6E3FA" width="14%">
															<div align="right" class="STYLE2">
																已传附件：
															</div>
														</td>
														<td colspan="3">
															<table width="60%" border="0" class=tablecolor2>
																<tr style="background-color: #D6E3FA;text-align: center;">
																	<td style="width: 40px">删除</td>
																	<td>名称</td>
																</tr>
																<c:forEach items="${attachList }" var="attachOne">
																<tr>
																	<td style="text-align: center;"><input name="attactId" type="checkbox" value="${attachOne.id }"/></td>
																	<td><a href="${ctx }/common/showFile.action?attach.id=${attachOne.id }">${attachOne.name }</a></td>
																</tr>
																</c:forEach>
															</table>
														</td>
													</tr>
													</c:if>
													<tr>
														<td bgcolor="D6E3FA" width="14%">
															
														</td>
														<td colspan="3">
															<button id="upladFileBtn" style="margin-right: 6px">保存</button>
															<button id="backHistoryBtn" type="button" onclick="javascript:history.go(-1);" style="margin-right: 6px">返回</button>
														</td>
													</tr>
												</table>
											                
							
							</form>
							
							</td>
						</tr>
						<tr>
							<td height="5">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="5" height="5"><img src="<c:url value="/images/cphdzx_tab3.gif"/>" width="5" height="5" /></td>
										<td class="tdborderbottom"><img src="<c:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
										<td width="5"><img src="<c:url value="/images/cphdzx_tab4.gif"/>" width="5" height="5" /></td>
									</tr>
								</table>
							</td>
						</tr>
					</table> 
				</td>
			</tr>
		</table>	
	</td>
	</tr>
</table>				
</body>
</html>
